#include <iostream>
#include <vector>
using namespace std;

vector<int> plusOne(vector<int> &digits) {
    // Start typing your C/C++ solution below
    // DO NOT write int main() function
    int carry = 0;
    for(int i=digits.size()-1; i>=0; --i){
        int cur = digits[i] + carry;
        if(i==digits.size()-1)
            ++cur;
        digits[i] = cur%10;
        carry = cur/10;
    }
    if(carry>0){
        digits.insert(digits.begin(), carry);
    }
    return digits;
}

int main(){
    return 0;
}